#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
const double PI=3.1415926535;
double getLineLen(double x1,double y1,double x2,double y2){
    return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

int main(void){
    int t;
    scanf("%d",&t);
    while(t--){
        double x1,y1,x2,y2;
        scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
        double lines[3];
        double xl=getLineLen(x1,y1,0.0,0.0);
        double yl=getLineLen(x2,y2,0.0,0.0);
        double zl=getLineLen(x1,y1,x2,y2);
        double ans=(xl*xl+yl*yl-zl*zl)/(2*xl*yl);
        printf("%.2lf\n",acos(ans)*180/PI);
    }
    return 0;
}